package tech.mhuang.fastdfs.aop.annoation;

import lombok.Getter;
import lombok.Setter;

/**
 * 等级
 *
 * @author mhuang
 * @since 1.0.0
 */
public enum Level {

    /**
     * ALL
     */
    ALL(0),
    QUERY(1),
    SAVE(2),
    UPDATE(3),
    DELETE(4);

    /**
     * value
     */
    @Setter
    @Getter
    public Integer value;

    Level(Integer value) {
        this.value = value;
    }

    public static Level getName(int value) {
        for (Level level : Level.values()) {
            if (level.value == value) {
                return level;
            }
        }
        return null;
    }

}
